home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / v cisle / htttrack / httrack-3.41-3.exe / {app} / src_win / WinHTTrack / NewProj.cpp < prev    next >
C/C++ Source or Header  |  2007-01-14  |  16KB  |  600 lines

  1. // NewProj.cpp : implementation file
  2. //
  3.  
  4. // pour lecture dir
  5. //#include "kernel32.h"
  6.  
  7. #include "stdafx.h"
  8. #include "Shell.h"
  9. #include "NewProj.h"
  10.  
  11. /* Externe C */
  12. extern "C" {
  13.   #include "HTTrackInterface.h"
  14.   #include "htscore.h"
  15. }
  16.  
  17. #include "XSHBrowseForFolder.h"
  18.  
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24.  
  25. extern HICON httrack_icon;
  26. extern CNewProj* dialog0;
  27.  
  28. // Helper
  29. extern LaunchHelp* HtsHelper;
  30.  
  31. /* Main WizTab frame */
  32. #include "WizTab.h"
  33. extern CWizTab* this_CWizTab;
  34.  
  35. /* Main splitter frame */
  36. #include "DialogContainer.h"
  37. #include "splitter.h"
  38. extern CSplitterFrame* this_CSplitterFrame;
  39.  
  40. /* DirTreeView */
  41. #include "DirTreeView.h"
  42. extern CDirTreeView* this_DirTreeView;
  43.  
  44. /* reference sur objet Wid1 */
  45. #include "Wid1.h"
  46. extern Wid1* dialog1;
  47.  
  48. /* shellapp */
  49. extern CShellApp* CShellApp_app;
  50.  
  51. /* crΘation structure */
  52. extern "C" HTSEXT_API int structcheck(const char* s);
  53.  
  54.  
  55. /////////////////////////////////////////////////////////////////////////////
  56. // CNewProj dialog
  57.  
  58. IMPLEMENT_DYNCREATE(CNewProj, CPropertyPage)
  59.  
  60. CNewProj::CNewProj()
  61.     : CPropertyPage(CNewProj::IDD)
  62. {
  63.   dialog0=this;    /* NOTER REFERENCE */
  64.   can_click_next=TRUE;
  65.     //{{AFX_DATA_INIT(CNewProj)
  66.     m_projname = _T("");
  67.     m_projpath = _T("");
  68.     m_projcateg = _T("");
  69.     //}}AFX_DATA_INIT
  70. }
  71.  
  72. CNewProj::~CNewProj() {
  73.   dialog0=NULL;
  74. }
  75.  
  76.  
  77. void CNewProj::DoDataExchange(CDataExchange* pDX)
  78. {
  79.     CPropertyPage::DoDataExchange(pDX);
  80.     //{{AFX_DATA_MAP(CNewProj)
  81.     DDX_Control(pDX, IDC_projcateg, m_ctl_projcateg);
  82.     DDX_Control(pDX, IDC_projname, m_ctl_projname);
  83.     DDX_Text(pDX, IDC_projname, m_projname);
  84.     DDX_Text(pDX, IDC_projpath, m_projpath);
  85.     DDX_CBString(pDX, IDC_projcateg, m_projcateg);
  86.     //}}AFX_DATA_MAP
  87. }
  88.  
  89.  
  90. #define wm_CEasyDropTargetCallback (WM_USER + 1)
  91. BEGIN_MESSAGE_MAP(CNewProj, CPropertyPage)
  92.     //{{AFX_MSG_MAP(CNewProj)
  93.     ON_BN_CLICKED(IDC_br, Onbr)
  94.     ON_EN_CHANGE(IDC_projpath, OnChangeprojpath)
  95.     ON_CBN_EDITCHANGE(IDC_projname, OnChangeprojname)
  96.     ON_WM_CREATE()
  97.     ON_CBN_SELCHANGE(IDC_projname, OnSelchangeprojname)
  98.     //}}AFX_MSG_MAP
  99.   ON_COMMAND(ID_HELP_FINDER,OnHelpInfo2)
  100.   ON_COMMAND(ID_HELP,OnHelpInfo2)
  101.     ON_COMMAND(ID_DEFAULT_HELP,OnHelpInfo2)
  102.   ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify )
  103.   //
  104.   ON_MESSAGE( wm_CEasyDropTargetCallback, DragDropText)
  105. END_MESSAGE_MAP()
  106.  
  107. /////////////////////////////////////////////////////////////////////////////
  108. // CNewProj message handlers
  109.  
  110. CString CNewProj::GetBasePath() {
  111.   CString st=m_projpath;
  112.   st.Replace('/','\\');
  113.   st+="\\";
  114.   return st;
  115. }
  116.  
  117. CString CNewProj::GetName() {
  118.   return m_projname;
  119. }
  120.  
  121. CString CNewProj::GetPath0() {
  122.   CString st=m_projpath;
  123.   st.Replace('/','\\');
  124.   st+="\\";
  125.   st+=m_projname;
  126.   return st;
  127. }
  128.  
  129. CString CNewProj::GetPath() {
  130.   CString st=GetPath0();
  131.   st+="\\";
  132.   return st;
  133. }
  134.  
  135. LRESULT CNewProj::OnWizardNext() {
  136.   CString st,stp="";
  137.   char tempo[8192];
  138.  
  139.   GetDlgItemText(IDC_projpath,stp);
  140.   strcpybuff(tempo,stp);
  141.   if ((tempo[strlen(tempo)-1]=='/') || (tempo[strlen(tempo)-1]=='\\'))
  142.     tempo[strlen(tempo)-1]='\0';
  143.   stp=tempo;
  144.  
  145.   // ecrire
  146.   CString strSection       = "DefaultValues";    
  147.   CWinApp* pApp = AfxGetApp();
  148.   pApp->WriteProfileString(strSection,"BasePath",stp);
  149.  
  150.   GetDlgItemText(IDC_projname,st);
  151.   st.TrimLeft();
  152.   st.TrimRight();
  153.   strcpybuff(tempo,st);
  154.   // caractΦres interdits
  155.   {
  156.     int i;
  157.     char* a=NULL;
  158.     for(i=0;i<9;i++)
  159.       while(a=strchr(tempo,("\\/:*?\"<>|")[i])) 
  160.         *a=' ';
  161.   }
  162.   //
  163.   //while(a=strchr(tempo,' ')) *a='_';      // PAS de _
  164.   SetDlgItemTextCP(this, IDC_projname,tempo);
  165.  
  166.   // ModifiΘ et sauvable
  167.   GetDlgItemText(IDC_projpath,stp);
  168.   if ((stp.Right(1)!="\\") && (stp.Right(1)!="/"))    // ajouter /
  169.     stp+="\\";
  170.   GetDlgItemText(IDC_projname,st);
  171.   this_CSplitterFrame->SetNewName(stp+st+".whtt");
  172.   //GetDlgItemText(IDC_projpath,st);
  173.   //this_CSplitterFrame->GetActiveDocument()->SetPathName(st);
  174.  
  175.   // Hack
  176.   {
  177.     CString st;
  178.     GetDlgItemText(IDC_projcateg, st);
  179.     this_CSplitterFrame->SetCurrentCategory(st);
  180.   }
  181.  
  182.   if (can_click_next)
  183.     return 0;
  184.   else
  185.     return -1;
  186. }
  187.  
  188. void CNewProj::Onbr() 
  189. {
  190.   CString st,spth;
  191.   char pth[256];
  192.   GetDlgItemText(IDC_projpath,spth);
  193.   strcpybuff(pth,spth);
  194.   st=XSHBrowseForFolder(this->m_hWnd,"Select a path name for mirror",pth);
  195.   if (st.GetLength()>0) {
  196.     if (st.Right(1)=='\\')
  197.       st=st.Left(st.GetLength()-1);
  198.     SetDlgItemTextCP(this, IDC_projpath,st);
  199.   }
  200.  
  201. }
  202.  
  203. BOOL CNewProj::OnInitDialog() 
  204. {
  205.     CPropertyPage::OnInitDialog();
  206.   SetIcon(httrack_icon,false);
  207.   SetIcon(httrack_icon,true);
  208.   EnableToolTips(true);     // TOOL TIPS
  209.   SetForegroundWindow();   // yop en premier plan!
  210.  
  211.   // disabled
  212.   OnChangeprojname();
  213.  
  214.   // Patcher l'interface pour les Franτais ;-)
  215.   if (LANG_T(-1)) {    // Patcher en franτais
  216.     SetWindowTextCP(this,  LANG(LANG_S10));
  217.     // SetDlgItemTextCP(this, IDOK,LANG(LANG_NEXT )); // "SUIVANT ->");
  218.     // SetDlgItemTextCP(this, IDCANCEL,LANG(LANG_QUIT));  // exit 
  219.     SetDlgItemTextCP(this, IDC_STATIC_projname,LANG(LANG_S11));
  220.     SetDlgItemTextCP(this, IDC_STATIC_basepath,LANG(LANG_S12));
  221.     SetDlgItemTextCP(this, IDC_STATIC_projcateg,LANG(LANG_S13));
  222.     //SetDlgItemTextCP(this, IDC_STATIC_updtcontinue,LANG(LANG_S13));
  223.   }
  224.   
  225.   CString strSection       = "DefaultValues";    
  226.   CWinApp* pApp = AfxGetApp();
  227.   CString st;
  228.  
  229.   st = pApp->GetProfileString(strSection, "BasePath");
  230.   if (m_projpath.GetLength()==0) {
  231.     if (st != "")
  232.       SetDlgItemTextCP(this, IDC_projpath,st);    
  233.     else
  234.       SetDlgItemTextCP(this, IDC_projpath,LANG(LANG_S20));    
  235.   }
  236.  
  237.   return TRUE;
  238. }
  239.  
  240. void CNewProj::OnChangeprojpath() 
  241. {
  242.   CWaitCursor wait;
  243.   CString st;
  244.   CString old_name;
  245.   char tempo[HTS_URLMAXSIZE*2];
  246.  
  247.   GetDlgItemText(IDC_projname,old_name);
  248.   GetDlgItemText(IDC_projpath,st);
  249.   tempo[0] = '\0';
  250.   strcatbuff(tempo, st);
  251.   if ((tempo[strlen(tempo)-1]=='/') || (tempo[strlen(tempo)-1]=='\\')) {
  252.     tempo[strlen(tempo)-1]='\0';
  253.     //SetDlgItemTextCP(this, IDC_projpath,tempo);
  254.   }
  255.   strcatbuff(tempo,"\\");
  256.  
  257.   TStamp t_start = mtime_local();
  258.  
  259.   // chargement de la liste
  260.   m_ctl_projname.ResetContent();
  261.   m_ctl_projcateg.ResetContent();
  262.   WIN32_FIND_DATA find;
  263.   char  pth[MAX_PATH + 32];
  264.   strcpybuff(pth,tempo);
  265.   strcatbuff(pth,"*.*");
  266.   HANDLE h = FindFirstFile(pth,&find);
  267.   if (h != INVALID_HANDLE_VALUE) {
  268.     do {
  269.       if (find.dwFileAttributes  & FILE_ATTRIBUTE_DIRECTORY )
  270.       if (!(find.dwFileAttributes  & (FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_HIDDEN) ))
  271.       if (strcmp(find.cFileName,".."))
  272.         if (strcmp(find.cFileName,".")) {
  273.           CString st;
  274.           st=tempo;
  275.           st=st+find.cFileName;
  276.           st=st+"\\hts-cache";
  277.           
  278.           WIN32_FIND_DATA find2;
  279.           HANDLE h2 = FindFirstFile(st,&find2);
  280.           if (h2 != INVALID_HANDLE_VALUE) {
  281.             FindClose(h2);
  282.             m_ctl_projname.AddString(find.cFileName);
  283.             
  284.             // Read category
  285.             st += "\\winprofile.ini";
  286.             CString strSection       = "OptionsValues";
  287.             CString categ = MyGetProfileString(st, strSection, "Category");
  288.             if (categ.GetLength() > 0 && m_ctl_projcateg.FindStringExact(0, categ) < 0) {
  289.               m_ctl_projcateg.AddString(categ);
  290.             }
  291.           }
  292.         }
  293.     } while(FindNextFile(h,&find));
  294.     FindClose(h);
  295.   }
  296.  
  297.   // nouveau nom!
  298.   SetDlgItemTextCP(this, IDC_projname,old_name);
  299.  
  300.   TStamp t_proj = mtime_local();
  301.  
  302.   OnChangeprojname();
  303.  
  304.   TStamp t_end = mtime_local();
  305.   TStamp l_dir = t_proj - t_start;
  306.   TStamp l_proj = t_end - t_proj;
  307.   //CString a;
  308.   //a.Format("%s: build=%dms proj=%dms", __FUNCTION__, (int)l_dir, (int)l_proj);
  309.   //(void) AfxMessageBox(a, MB_OK);
  310. }
  311.  
  312.  
  313.  
  314. // ------------------------------------------------------------
  315. // TOOL TIPS
  316. //
  317. // ajouter dans le .cpp:
  318. // remplacer les deux Wid1:: par le nom de la classe::
  319. // dans la message map, ajouter
  320. // ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify )
  321. // dans initdialog ajouter
  322. // EnableToolTips(true);     // TOOL TIPS
  323. //
  324. // ajouter dans le .h:
  325. // char* GetTip(int id);
  326. // et en generated message map
  327. // afx_msg BOOL OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult );
  328. BOOL CNewProj::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
  329. {
  330.   TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
  331.   UINT_PTR nID =pNMHDR->idFrom;
  332.   if (pTTT->uFlags & TTF_IDISHWND)
  333.   {
  334.     // idFrom is actually the HWND of the tool
  335.     nID = ::GetDlgCtrlID((HWND)nID);
  336.     if(nID)
  337.     {
  338.       char* st=GetTip((int)nID);
  339.       if (st != "") {
  340.         pTTT->lpszText = st;
  341.         pTTT->hinst = AfxGetResourceHandle();
  342.         return(TRUE);
  343.       }
  344.     }
  345.   }
  346.   return(FALSE);
  347. }
  348. char* CNewProj::GetTip(int ID)
  349. {
  350.   switch(ID) {
  351.     case IDC_projname:  return LANG(LANG_S1); break;
  352.     case IDC_projpath:  return LANG(LANG_S2); break;
  353.     case IDC_projcateg: return LANG(LANG_S5); break;
  354.     //case IDC_projlist:  return LANG(LANG_S3); break;
  355.     case IDC_br:        return LANG(LANG_S4); break;
  356.     case IDCANCEL:     return LANG(LANG_G20); break; // "Quit WinHTTrack","Quittter WinHTTrack"); break;
  357.     case IDOK:         return LANG(LANG_G23); break; // "Click to continue","Clic pour continuer"); break;
  358.   }
  359.   return "";
  360. }
  361. // TOOL TIPS
  362. // ------------------------------------------------------------
  363.  
  364.  
  365. void CNewProj::OnChangeprojname() 
  366. {
  367.   CString stl;
  368.   BOOLEAN modified = FALSE;
  369.   int i;
  370.   GetDlgItemText(IDC_projname,stl);
  371.   for(i = 0 ; i < stl.GetLength() ; i++) {
  372.     if (stl[i] == '\"') {
  373.       stl.GetBuffer(0)[i] = '\'';
  374.       modified = TRUE;
  375.     }
  376.     else if (stl[i] == ',' 
  377.       || stl[i] == '~'
  378.       || stl[i] == '\\'
  379.       || stl[i] == '/'
  380.       || stl[i] == ':'
  381.       || stl[i] == '*'
  382.       || stl[i] == '?'
  383.       || stl[i] == '<'
  384.       || stl[i] == '>'
  385.       || stl[i] == '|'
  386.       || stl[i] == '#'
  387.       || stl[i] == '$'
  388.       || ((unsigned char)stl[i]) < 32
  389.       ) {
  390.       stl.GetBuffer(0)[i] = '_';
  391.       modified = TRUE;
  392.     }
  393.   }
  394.   if (modified) {
  395.     DWORD dwSel=0;
  396.     dwSel = m_ctl_projname.GetEditSel();
  397.     SetDlgItemTextCP(this, IDC_projname, stl);
  398.     m_ctl_projname.SetEditSel(HIWORD(dwSel), LOWORD(dwSel));
  399.   }
  400.   Changeprojname(stl);
  401. }
  402.  
  403.  
  404. void CNewProj::Changeprojname(CString stl) {
  405.     char catbuff[CATBUFF_SIZE];
  406.     CWaitCursor wait;
  407.   CString st;
  408.   //
  409.   if (stl.GetLength()==0 || stl.GetLength() > HTS_URLMAXSIZE) {
  410.     //m_ctl_idok.ModifyStyle(0,WS_DISABLED);
  411.     SetDlgItemTextCP(this, IDC_STATIC_comments,LANG(LANG_S30));
  412.     SetDlgItemTextCP(this, IDC_STATIC_projname,LANG(LANG_S11c));
  413.     this_CWizTab->SetWizardButtons(PSWIZB_BACK);
  414.     can_click_next=FALSE;
  415.   } else {
  416.     char tempo[HTS_URLMAXSIZE*2];
  417.     GetDlgItemText(IDC_projpath,st);
  418.     if (st.GetLength() + stl.GetLength() + 32 > sizeof(tempo)) {
  419.       can_click_next=FALSE;
  420.     } else {
  421.       strcpybuff(tempo,st);
  422.       strcatbuff(tempo,"/");
  423.       strcatbuff(tempo,stl);
  424.       strcatbuff(tempo,"/");
  425.       if (fexist(fconcat(catbuff,tempo,"hts-cache/winprofile.ini"))     // un cache est prΘsent
  426.         && fsize(fconcat(catbuff,tempo,"hts-cache/winprofile.ini"))>0) {   // taille log contr⌠le>0
  427.         CString strSection       = "OptionsValues";
  428.         CString st  = MyGetProfileString(fconcat(catbuff,tempo,"hts-cache/winprofile.ini"),strSection,"CurrentUrl");
  429.         CString st2 = MyGetProfileString(fconcat(catbuff,tempo,"hts-cache/winprofile.ini"),strSection,"Category");
  430.         //
  431.         SetDlgItemTextCP(this, IDC_STATIC_comments, st);
  432.         SetDlgItemTextCP(this, IDC_projcateg, st2);
  433.         // Static
  434.         SetDlgItemTextCP(this, IDC_STATIC_projname,LANG(LANG_S11b));
  435.       } else {
  436.         SetDlgItemTextCP(this, IDC_STATIC_comments,LANG(LANG_S31));
  437.         SetDlgItemTextCP(this, IDC_STATIC_projname,LANG(LANG_S11));
  438.       }
  439.       //m_ctl_idok.ModifyStyle(WS_DISABLED,0);
  440.       //if (!can_click_next)
  441.       this_CWizTab->SetWizardButtons(PSWIZB_BACK|PSWIZB_NEXT);
  442.       can_click_next=TRUE;
  443.     }
  444.   }
  445.   //m_ctl_idok.RedrawWindow();
  446. }
  447.  
  448.  
  449. // help
  450. // Appel aide
  451. void CNewProj::OnHelpInfo2() {
  452.   (void)  OnHelpInfo(NULL);
  453. }
  454.  
  455. BOOL CNewProj::OnHelpInfo(HELPINFO* dummy) 
  456. {
  457.   //return CPropertyPage::OnHelpInfo(pHelpInfo);
  458.   //AfxGetApp()->WinHelp(0,HELP_FINDER);    // Index du fichier Hlp
  459.   HtsHelper->Help("step1.html");
  460.   //HtsHelper->Help();
  461.   return true;
  462. }
  463.  
  464.  
  465. extern HWND App_Main_HWND;
  466. int CNewProj::OnCreate(LPCREATESTRUCT lpCreateStruct) 
  467. {
  468.   //lpCreateStruct->hwndParent=AfxGetApp()->GetMainWnd()->m_hWnd;
  469.   lpCreateStruct->hwndParent=App_Main_HWND;
  470.     if (CPropertyPage::OnCreate(lpCreateStruct) == -1)
  471.         return -1;
  472.     
  473.   // Drag&Drop
  474.   drag=new CEasyDropTarget(this);
  475.   if (drag->IsRegistered()) {
  476.     drag->SetTextCallback(wm_CEasyDropTargetCallback);
  477.   }
  478.     
  479.     return 0;
  480. }
  481.  
  482. // Message from CEasyDropTarget
  483. LRESULT CNewProj::DragDropText(WPARAM wParam,LPARAM lParam) {
  484.   if (lParam) {
  485.     CString st=*((CString*) lParam);
  486.     CLIPFORMAT cfFormat = (CLIPFORMAT) wParam;
  487.     if (cfFormat==CF_HDROP) {
  488.       if (st.Right(5).CompareNoCase(".whtt")==0)
  489.         st=st.Left(st.GetLength()-5);
  490.       if(st.GetLength()<256) {
  491.         char s[256];
  492.         strcpybuff(s,st);
  493.         if (!fexist(s)) {
  494.           if (st.Find('\n')<0) {
  495.             int pos=st.ReverseFind('\\');
  496.             SetDlgItemTextCP(this, IDC_projpath,st.Mid(0,pos));
  497.             SetDlgItemTextCP(this, IDC_projname,st.Mid(pos+1));
  498.             //
  499.             OnChangeprojpath();
  500.             OnChangeprojname();
  501.           } else
  502.             AfxMessageBox(LANG(LANG_DIAL3),MB_SYSTEMMODAL);
  503.         } else
  504.           AfxMessageBox(LANG(LANG_DIAL4),MB_SYSTEMMODAL);
  505.       }
  506.     } else
  507.       AfxMessageBox(LANG(LANG_DIAL5),MB_SYSTEMMODAL);
  508.   }
  509.   return 0;
  510. }
  511.  
  512.  
  513. void CNewProj::OnSelchangeprojname() 
  514. {
  515.   CString stl;
  516.   int r;
  517.   if ((r=m_ctl_projname.GetCurSel()) != CB_ERR) {
  518.     m_ctl_projname.GetLBText(r,stl);
  519.   } else
  520.     GetDlgItemText(IDC_projname,stl);
  521.   Changeprojname(stl);
  522. }
  523.  
  524. BOOL CNewProj::OnSetActive( ) {
  525.   //this_CWizTab->SetWizardButtons(PSWIZB_BACK);
  526.  
  527.   WHTT_LOCATION("NewProj");
  528.   //if (!can_click_next) {
  529.   // structure visible
  530.   CString st;
  531.   GetDlgItemText(IDC_projpath,st);    
  532.   TStamp t_start = mtime_local();
  533.   // FIXME: VERY SLOW!!
  534.   this_DirTreeView->EnsureVisible(st+"\\index.html");
  535.   TStamp t_end = mtime_local();
  536.  
  537.   //TStamp l_dir = t_end - t_start;
  538.   //CString a;
  539.   //a.Format("t=%dms", (int)l_dir);
  540.   //(void) AfxMessageBox(a, MB_OK);
  541.  
  542.   SetDlgItemTextCP(this_CWizTab, IDCANCEL,LANG_CANCEL);
  543.   //} else
  544.   //this_CWizTab->PressButton(PSBTN_NEXT);
  545.   
  546.   return 1;
  547. }
  548.  
  549. BOOL CNewProj::OnQueryCancel( ) {
  550.   this_CSplitterFrame->SetNewView(0,1,RUNTIME_CLASS(CDialogContainer));
  551.   return 0;
  552. }
  553.  
  554. BOOL CNewProj::OnKillActive( ) {
  555.   CString st;
  556.   char tempo[HTS_URLMAXSIZE*2];
  557.   GetDlgItemText(IDC_projpath,st);
  558.   strcpybuff(tempo,st);
  559.   if ((tempo[strlen(tempo)-1]=='/') || (tempo[strlen(tempo)-1]=='\\')) {
  560.     tempo[strlen(tempo)-1]='\0';
  561.     SetDlgItemTextCP(this, IDC_projpath,tempo);
  562.   }
  563.  
  564.   UpdateData(TRUE);         // DoDataExchange
  565.  
  566.   // crΘer structure
  567.   {
  568.     char dest[HTS_URLMAXSIZE*2];
  569.     int i=0;
  570.     strcpybuff(dest,GetPath()+"hts-cache\\");
  571.     {
  572.       char* a;
  573.       while(a=strchr(dest,'\\')) *a='/';
  574.       structcheck(dest);
  575.     }
  576.   }
  577.  
  578.   CShellApp_app->end_path=dialog0->GetBasePath();
  579.   CShellApp_app->end_path_complete=dialog0->GetPath();
  580.   Build_TopIndex(FALSE);
  581.  
  582.   // structure visible
  583.   TStamp t_start = mtime_local();
  584.   // FIXME: VERY SLOW!!
  585.   this_DirTreeView->EnsureVisible(GetPath()+"hts-cache");
  586.   TStamp t_end = mtime_local();
  587.  
  588.   //TStamp l_dir = t_end - t_start;
  589.   //CString a;
  590.   //a.Format("t=%dms", (int)l_dir);
  591.   //(void) AfxMessageBox(a, MB_OK);
  592.  
  593.   // charger prΘfs
  594.   dialog1->OnChangepathlog();
  595.  
  596.   return 1;
  597. }
  598.  
  599.  
  600.